From b675a13233c890a188d99b6f1b66b428a7078f6a Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Thu, 14 Aug 2014 15:44:35 +0200 Subject: [PATCH] button: Remove depressed_on_activate All buttons should always be marked as :active when they are pressed. That includes checkboxes (which are never activated in real code anyway, so this change pretty much doesn't matter). --- gtk/gtkbutton.c | 3 +-- gtk/gtkbuttonprivate.h | 1 - gtk/gtkradiobutton.c | 2 -- gtk/gtktogglebutton.c | 3 --- 4 files changed, 1 insertion(+), 8 deletions(-) diff --git a/gtk/gtkbutton.c b/gtk/gtkbutton.c index 5116cf1e19..63fb9cf80a 100644 --- a/gtk/gtkbutton.c +++ b/gtk/gtkbutton.c @@ -628,7 +628,6 @@ gtk_button_init (GtkButton *button) priv->button_down = FALSE; priv->use_stock = FALSE; priv->use_underline = FALSE; - priv->depress_on_activate = TRUE; priv->focus_on_click = TRUE; priv->xalign = 0.5; @@ -2458,7 +2457,7 @@ gtk_button_update_state (GtkButton *button) gboolean depressed; if (priv->activate_timeout) - depressed = priv->depress_on_activate; + depressed = TRUE; else depressed = priv->in_button && priv->button_down; diff --git a/gtk/gtkbuttonprivate.h b/gtk/gtkbuttonprivate.h index f7177852a3..423088fab1 100644 --- a/gtk/gtkbuttonprivate.h +++ b/gtk/gtkbuttonprivate.h @@ -53,7 +53,6 @@ struct _GtkButtonPrivate guint align_set : 1; guint button_down : 1; guint constructed : 1; - guint depress_on_activate : 1; guint focus_on_click : 1; guint image_is_stock : 1; guint in_button : 1; diff --git a/gtk/gtkradiobutton.c b/gtk/gtkradiobutton.c index 6d3dec3a24..131348a939 100644 --- a/gtk/gtkradiobutton.c +++ b/gtk/gtkradiobutton.c @@ -208,8 +208,6 @@ gtk_radio_button_init (GtkRadioButton *radio_button) _gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (radio_button), TRUE); - GTK_BUTTON (radio_button)->priv->depress_on_activate = FALSE; - priv->group = g_slist_prepend (NULL, radio_button); gtk_widget_set_state_flags (GTK_WIDGET (radio_button), GTK_STATE_FLAG_CHECKED, TRUE); diff --git a/gtk/gtktogglebutton.c b/gtk/gtktogglebutton.c index 1a0580e488..cca85e9fbb 100644 --- a/gtk/gtktogglebutton.c +++ b/gtk/gtktogglebutton.c @@ -229,8 +229,6 @@ gtk_toggle_button_init (GtkToggleButton *toggle_button) toggle_button->priv = gtk_toggle_button_get_instance_private (toggle_button); toggle_button->priv->active = FALSE; toggle_button->priv->draw_indicator = FALSE; - - GTK_BUTTON (toggle_button)->priv->depress_on_activate = TRUE; } static void @@ -419,7 +417,6 @@ gtk_toggle_button_set_mode (GtkToggleButton *toggle_button, GtkStyleContext *context; priv->draw_indicator = draw_indicator; - GTK_BUTTON (toggle_button)->priv->depress_on_activate = !draw_indicator; if (gtk_widget_get_visible (GTK_WIDGET (toggle_button))) gtk_widget_queue_resize (GTK_WIDGET (toggle_button)); -- 2.30.2